<?php

/* @var $this yii\web\View */
$this->registerCssFile('/css/user/home.css?v=1.0.10');

$this->registerJsFile('/js/jquery.min.js');
$this->registerJsFile('/js/layer/layer.js');
$this->registerJsFile('/js/tools.js?v=1.0.1');
$this->registerJsFile('/js/user/home.js?v=1.0.11');
$this->title = $user['username'];
$this->metaTags[]="<meta name='keywords' content='现代诗,诗歌,歌词,现代诗歌,现代诗歌大全,现代诗歌精选,诗歌大全,新格律,".$user['username']."'/>";
$this->metaTags[]="<meta name='description' content='".$user['introduce']."'/>";
?>
<div class="user-home-page">
    <div class="user-home-head">
        <div class="user-head-img-outter"><img class="user-head-img" src="<?=$user['headimg']?>"/></div>
        <div class="user-info-outter">
            <div class="username"><?=$user['username']?></div>
            <div class="introduce"><?=$user['introduce']?></div>
        </div>
        <div class="user-body-outter">
            <div class="user-count">
                <div class="count-item">
                    <?=$works_num?><br/>作品
                </div>
                <div class="count-item">
                    <?=$fan_num?><br/>粉丝
                </div>
            </div>
            <div class="user-likes-outter">
            <?php if($is_self==0){ ?>
                <span class="likes-button" id="interest" data-id="<?=$user['id']?>" data-interested="<?= $is_interested?>"></span>
            <?php }elseif($is_self==1){ ?>
                <span class="personal-button">个人中心</span>
            <?php }?>
            </div>
        </div>
        
    </div>
    <div class="user-works-part">
        <?php foreach($works as $work){ ?>
        <div class="works-outter">
            <div class="works-head">
                <div class="headimg-area">
                    <img src="<?=$user['headimg']?>" class="works-user-headimg"/>
                </div>
                <div class="works-auther">
                    <div class="auther-name"><?=$user['username']?></div>
                    <div class="works-time"><?= $work['addtime']?></div>
                </div>
            </div>
            
            <div class="works-body">
                <a href="/works/detail?worksid=<?= $work['id']?>">
                <div class="works-title">
                    《<?= $work['title']?>》
                </div>
                <div class="works-content" data-id="<?= $work['id']?>"><?= $work['content']?></div>
                </a>
            </div>
            <div class="comment-area">
                <span class="comment-button"  data-id="<?= $work['id']?>" data-title="<?= $work['title']?>" data-author="<?= $user['username']?>" data-authorid="<?= $user['id']?>"></span><span class="comment-num" id="commentnum_<?= $work['id']?>" data-id="<?= $work['id']?>"><?= $work['comment_num']?></span>
                <span class="shoucang <?php echo $work['is_collection'] == 1 ?  "collectioned":"uncollectioned";?>" id="like-<?= $work['id']?>" data-id="<?= $work['id']?>"></span><span class="comment-num" id="collectnum_<?= $work['id']?>" data-id="<?= $work['id']?>"><?= $work['collect_num']?></span>
            </div>
        </div>
        <?php } ?>
    </div>
</div>